package com.quwan.common;

import com.quwan.common.enums.BalancePayTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author quan
 * @date 2021-11-22 10:16
 */

@Getter
@AllArgsConstructor
public enum ImMsgType {
    text("TIMTextElem", "文本消息"),
    location("TIMLocationElem", "位置消息"),
    custom("TIMCustomElem", "自定义消息"),
    sound("TIMSoundElem", "语音消息"),
    face("TIMFaceElem", "表情消息"),
    img("TIMImageElem", "图像消息"),
    file("TIMFileElem", "文件消息"),
    video("TIMVideoFileElem", "视频消息");

    String code;
    String desc;

    public static ImMsgType getByCode(String code) {
        for (ImMsgType value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
